import {
  http
} from '@/api/service.js'
/**
 * 收藏夹
 * @param {Object} data - 查询数据
 * @param {Object} params - 查询params参数
 */
export const favorites = (data, params) => {
  return http.middleware({
    method: 'POST', // 必须大写
    url: '/database/favorites',
    data: data,
    params: params,
    custom: {
      auth: true
    }
  })
}
/**
 * 删除收藏夹
 * @param {Object} data - 查询数据
 * @param {Object} params - 查询params参数
 */
export const deleteFavorites = (data, params) => {
  return http.middleware({
    method: 'POST', // 必须大写
    url: '/database/deleteFavorites',
    data: data,
    params: params,
    custom: {
      auth: true
    }
  })
}
/**
 * 新增收藏夹
 * @param {Object} data - 查询数据
 * @param {Object} params - 查询params参数
 */
export const createFavorites = (data, params) => {
  return http.middleware({
    method: 'POST', // 必须大写
    url: '/database/createFavorites',
    data: data,
    params: params,
    custom: {
      auth: true
    }
  })
}
/**
 * 修改收藏夹名称
 * @param {Object} data - 查询数据
 * @param {Object} params - 查询params参数
 */
export const updateFavorites = (data, params) => {
  return http.middleware({
    method: 'POST', // 必须大写
    url: '/database/updateFavorites',
    data: data,
    params: params,
    custom: {
      auth: true
    }
  })
}
/**
 * 收藏列表
 * @param {Object} data - 查询数据
 * @param {Object} params - 查询params参数
 */
export const collectionList = (data, params) => {
  return http.middleware({
    method: 'POST', // 必须大写
    url: '/database/collectionList',
    data: data,
    params: params,
    custom: {
      auth: true
    }
  })
}
/**
 * 批量删除收藏
 * @param {Object} data - 查询数据
 * @param {Object} params - 查询params参数
 */
export const batchDeleteCollection = (data, params) => {
  return http.middleware({
    method: 'POST', // 必须大写
    url: '/database/batchDeleteCollection',
    data: data,
    params: params,
    custom: {
      auth: true
    }
  })
}